package org.jeecg.modules.kuner.bankcardbase.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.kuner.bankcardbase.entity.KrBankcardBase;
import org.jeecg.modules.kuner.bankcardbase.mapper.KrBankcardBaseMapper;
import org.jeecg.modules.kuner.bankcardbase.service.IKrBankcardBaseService;
import org.jeecg.modules.putil.LoginUserUtil;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 银行卡管理
 * @Author: jeecg-boot
 * @Date: 2025-02-24
 * @Version: V1.0
 */
@Service
public class KrBankcardBaseServiceImpl extends ServiceImpl<KrBankcardBaseMapper, KrBankcardBase> implements IKrBankcardBaseService {

    @Resource
    private LoginUserUtil loginUserUtil;

    /**
     * 查询我的银行卡信息
     *
     * @return 查询结果
     */
    @Override
    public List<KrBankcardBase> myBankcard() {
        return list(new LambdaQueryWrapper<KrBankcardBase>().eq(KrBankcardBase::getUserId, loginUserUtil.getLoginUser().getId()));
    }
}
